<form id="form_add_clockin_activity" enctype="multipart/form-data" method="post" action="#" class="form">
    <input type="hidden" name="page_code" value="clockin_activity" />
    <div class="wrapper-form" id="form_content_add_clockin_activity">
    </div>
</form>
<script>
    $(function(){
        var pageCode = "clockin_activity";
        var columnList = getAddFormColumnList(pageCode);
        console.log("column list:", columnList);
        var formHtml = '';
        var arrEasyuiClass = {
            date:"easyui-datebox",
            datetime: "easyui-datetimebox"
        };
        $.each(columnList, function(index, item){
            var requireHtml = '';
            var classNameHtml = 'input-txt';
            if(1 == item.is_require){
                requireHtml = '<em>*</em>';
            }

            formHtml += '<dl class="row">';
            formHtml += '<dt class="tit"><label>' + requireHtml + item.column_title + '</label></dt>';
            if('select' == item.element_type){
                var subOptionList = getDictionarySubOption(item.dictionary_id);
                formHtml += '<dd class="opt"><select name="' + item.column_name + '"  class="' + classNameHtml + '"  >';
                formHtml += '<option value="">请选择</option>';
                $.each(subOptionList, function(subIndex, subOptionItem){
                    formHtml += '<option value="' + subOptionItem.sub_value + '">' + subOptionItem.sub_name + '</option>';
                });
                formHtml += '</select></dt>';
            }else{
                if(arrEasyuiClass.hasOwnProperty(item.element_type)){
                    classNameHtml += " " + arrEasyuiClass[item.element_type];
                }
                formHtml += '<dd class="opt"><input name="' + item.column_name + '"  class="' + classNameHtml + '"  /></dt>';
            }
            formHtml += '</dl>';
        });
        formHtml += ' <dl class="row">' +
            '            <dt class="tit">' +
            '                <label>状态</label>' +
            '            </dt>' +
            '            <dd class="opt">' +
            '                <label><input type="radio" value="1" checked="checked" name="status">启用</label>' +
            '                <label><input type="radio" value="0" name="status">禁用</label>' +
            '                <span class="err"></span>' +
            '            </dd>' +
            '        </dl>';
        $("#form_content_add_clockin_activity").html(formHtml);
        $.parser.parse("#form_content_add_clockin_activity");
    });
</script>
